package com.example.demo.thy32controller;

        import com.example.demo.thy32model.book1;
        import org.springframework.stereotype.Controller;
        import org.springframework.web.bind.annotation.RequestMapping;
        import org.springframework.web.context.request.WebRequest;

        import java.util.ArrayList;
        import java.util.List;


@Controller
public class loop {
    @RequestMapping("/loop")
    public String  book2 (WebRequest webRequest ){
        List<book1> books =new ArrayList<book1>();
        books.add(new book1(1,"疯狂JAVA","1.jpg","Ligang",109.00) );
        books.add(new book1(2,"疯狂JAVA2","1.jpg","Ligang",109.00) );
        books.add(new book1(3,"疯狂JAVA3","1.jpg","Ligang",109.00) );
        books.add(new book1(4,"疯狂JAVA4","1.jpg","Ligang",109.00) );
        webRequest .setAttribute("books",books ,webRequest .SCOPE_REQUEST );
        return"success3";
    }
}
